package it.maganar.lesscaos.client;
import java.util.Properties;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import it.maganar.lesscaos.session.*;

public class NetworkConnector {

	static public ServiceGateRemote sgr;
	
	public NetworkConnector() {
		try {
			Properties props = new Properties(); 
	        props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory"); 
	        props.put(Context.PROVIDER_URL, "jnp://localhost:1099"); 
	        Context jndiContext = new InitialContext(props); 
			Object ref = jndiContext.lookup("Less-CAOS/ServiceGate/remote");
			sgr = (ServiceGateRemote)ref;
			
		} catch (NamingException e) {
			e.printStackTrace();
		}
	}
	
	
	
}
